package cn.factorybox.item.mapper;

import cn.factorybox.model.entity.FactoryJudgeValue;
import cn.factorybox.model.entity.FactoryDeviceData;

import java.util.List;
import java.util.Map;

/**
 * @author flypig
 * @version 1.0
 * @date 2020-09-13 14:51
 */
public interface FactoryDeviceDataMapper {

    Map<String, Object> getPeak(String fSerialNumber);

    List<FactoryDeviceData> getChangeCurveData(Map<String, Object> params);

    int delete(String id);

    void editThreshold(Map range);

    int addAbnormal(Map<String, Object> map);

    List<Map<String, Object>> selectOneDeviceData(Map<String, Object> map);

    List<Map<String, Object>> getAbnormalMessageList(Map<String, Object> map);

    int deleteAbnormalData(String id);

    List<Map<String, Object>> getAbnormalDataList(String fSerialNumber);

    Double getSumData(String fSerialNumber);

    Double getAbnormalSum(String name, String fSerialNumber);

    Double getAllAbSum(String fSerialNumber);

    int deleteDataByDeviceId(String id);

    List<Map<String, Object>> getNewestData(String fSerialNumber);

    int saveFactoryDeviceData(FactoryDeviceData factoryDeviceData);

    List<FactoryDeviceData> selectDataList(String roomId, String date);

    FactoryDeviceData selectLastestData(String id);

    List<FactoryDeviceData> selectThirtyOneDataList(String id);

    FactoryDeviceData selectLastestOfRoom(String companyId, Integer number);

    Double countAllOfRoom(String companyId, Integer number);

    Double countNormalOfRoom(String companyId, Integer number);

    Double countWarningOfRomm(String companyId, Integer number);

    List<Double> selectHumListOfRoom(String companyId, Integer number);

    List<Double> selectTempListOfRoom(String companyId, Integer number);

    List<Double> selectTempListOfDevice(String deviceId);

    FactoryDeviceData selectLastestDataOfDevice(String id);

    List<Integer> countWarningOfEachItem(String id);

    Integer countAllOfSingleDevice(String id);

    Integer countNormalOfSingleDevice(String id);

    Integer countWarningOfSingleDevice(String id);

    List<Integer> countAllBeforeAweekByDeviceId(String id);
}
